<?php

/**
 * 数据统计相关 Model
 */
class dataTotalModel
{

    /**
     * 基类
     * @var object
     */
    private $base;

    /**
     * Mysql 连接
     * @var resources
     */
    private $logDb;

    /**
     * Redis 连接
     * @var resources
     */
    private $redis;

    public function __construct(& $base)
    {
        $this->base = $base;
        $this->base->in_logDb();
        $this->logDb = & $this->base->logDb;
        $this->redis = & $this->base->redis;
    }

    /**
     * 获取客户端统计数据
     * @param integer $num
     * @return array
     */
    public function getClientTotal($num = 30)
    {
        return $this->logDb->getAll("select * from client_total order by id desc limit 0,{$num}");
    }
}